<template>
  <div class="container">
    <div class="header">
      <div class="back-button" @click="goBack">&#10094;</div>
      <div class="title">取消订单</div>
    </div>
    <div class="content">
      <p class="driver-distance">司机距你100米，预计1分钟后到达</p>
      <button class="contact-driver-button">联系司机</button>
      <p class="cancel-info">本次取消免费，多次取消影响信誉。</p>
      <a href="your-link-here" class="view-rules-link">查看取消规则</a>
      <button class="confirm-cancel-button" @click="confirmCancel">确定取消</button>
      <button class="decline-cancel-button" @click="declineCancel">暂不取消</button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CancelOrderPage',
  methods: {
    goBack() {
      // 实现返回逻辑
      this.$router.go(-1);
    },
    confirmCancel() {
      // 实现确定取消订单的逻辑
    },
    declineCancel() {
      // 实现暂不取消订单的逻辑，比如返回上一个页面或关闭当前页面
    }
  }
}
</script>

<style scoped>
.container {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}
.header {
  background-color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.back-button {
  cursor: pointer;
  font-size: 24px;
  margin-right: 10px;
  position: absolute;
  left: 20px;
}
.title {
  font-size: 20px;
  font-weight: bold;
}
.content {
  padding: 20px;
}
.driver-distance {
  font-size: 18px;
  font-weight: bold;
  color: #666;
  margin-bottom: 10px;
}
.contact-driver-button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}
.contact-driver-button:hover {
  background-color: #0056b3;
}
.cancel-info {
  text-align: center; /* 设置文本居中 */
  font-size: 14px;
  color: #888; /* 浅灰色，可根据实际需要调整 */
  margin-top: 10px; /* 添加顶部间距 */
}

.view-rules-link {
  display: block; /* 使链接独占一行 */
  text-align: center; /* 文本居中 */
  font-size: 14px;
  color: #007bff; /* 蓝色链接颜色 */
  text-decoration: none; /* 去除下划线 */
  margin-top: 10px; /* 添加顶部间距 */
}

.view-rules-link:hover {
  text-decoration: underline; /* 鼠标悬停时添加下划线 */
}

.confirm-cancel-button,
.decline-cancel-button {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
  transition: background-color 0.3s, border-color 0.3s;
}

.confirm-cancel-button {
  margin-right: 10px; /* 按钮之间的间距 */
}

.confirm-cancel-button:hover {
  background-color: #f44336; /* 红色背景表示取消动作 */
  border-color: #d32f2f;
}

.decline-cancel-button:hover {
  background-color: #4CAF50; /* 绿色背景表示保留订单 */
  border-color: #388e3e;
}
</style>
